<?php

namespace Addons\Zmphoto\Model;

/**
 * Electron模型
 * 白红蓝
 */
class ElectronModel extends PublicModel{
    protected $tableName = 'photo_zm_electron';
    protected $errormsg;
    //初始化
    public function getErrorMsg(){
        return $this->errormsg;
    }
    //获取活动列表
    public function getList($map,$order){
        $list = $this->where($map)->order($order)->select();
        return $list;
    }
    
    //获取活动访问量
    public function getCount($map){
        $count = $this->where($map)->count();
        return $count;
    }
    //获取活动详情
    public function getInfo($map) {
        $info = $this->where($map)->find();
        return $info;
    }
    //获取活动个别信息
    public function getnumber($map,$data) {
        $info = $this->where($map)->getField($data);
        return $info;
    }
    //保存信息
    public function getsave($map,$data) {
        $info = $this->where($map)->save($data);
        return $info;
    }
    //添加信息
    public function getadd($data) {
        $info = $this->add($data);
        return $info;
    }
    //答题次数+1
    public function frequency($map,$data)
    {
    
        $info = $this -> where($map) -> setInc($data);
        return $info;
    }
    //获取总积分
    public function getscore($map)
    {
        $info = $this->where($map)->find();
        return $info;
    }
}
